package com.xiguaji.tiktok.v1.ins.blogger.controller;


import com.xiguaji.boot.toolkit.jdbc.Page;
import com.xiguaji.tiktok.config.exception.ParamsException;
import com.xiguaji.tiktok.utils.Ret;
import com.xiguaji.tiktok.v1.InsBaseController;
import com.xiguaji.tiktok.v1.ins.blogger.dto.*;
import com.xiguaji.tiktok.v1.ins.blogger.dto.es.InsBlogger;
import com.xiguaji.tiktok.v1.ins.blogger.service.InsBloggerFansService;
import com.xiguaji.tiktok.v1.ins.blogger.service.InsBloggerService;
import com.xiguaji.tiktok.v1.ins.favorite.dto.FavoriteTypeEnum;
import com.xiguaji.tiktok.v1.ins.favorite.model.InsFavorite;
import com.xiguaji.tiktok.v1.ins.favorite.service.InsFavoriteService;
import com.xiguaji.tiktok.v1.ins.media.dto.InsAdMediaTagSearchRequest;
import com.xiguaji.tiktok.v1.ins.media.service.InsMediaService;
import com.xiguaji.tiktok.v1.ins.product.dto.InsProductRelListRequest;
import com.xiguaji.tiktok.v1.ins.product.service.InsProductService;
import com.xiguaji.tiktok.v1.product.dto.PlatformTypeEnum;
import com.xiguaji.tiktok.v1.product.dto.ReportTypeEnum;
import com.xiguaji.tiktok.v1.product.service.ProductService;
import com.xiguaji.tiktok.v1.tiktok.permission.Limit;
import com.xiguaji.tiktok.v1.tiktok.permission.RequestLimit;
import com.xiguaji.tiktok.v1.user.log.Operation;
import com.xiguaji.tiktok.v1.user.log.ParamsType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * InsBloggerController
 * @author
 */
@RestController
@Api(value = "ins博主",tags = {"ins博主"})
public class InsBloggerController extends InsBaseController {

    /**
     * insBloggerService
     */
    @Autowired
    InsBloggerService insBloggerService;

    /**
     * insBloggerFansService
     */
    @Autowired
    InsBloggerFansService insBloggerFansService;

    /**
     * insMediaService
     */
    @Autowired
    InsMediaService insMediaService;

    /**
     *
     */
    @Autowired
    ProductService productPerService;

    @Autowired
    InsProductService insProductService;

    @Autowired
    InsFavoriteService insFavoriteService;

    @ApiOperation(value = "获取INS博主列表")
    @RequestMapping(value = "blogger",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "InsSearchPageLimit",property = "page,pageSize",validateType = Limit.VIEW_DATA_LIMIT)
    @Operation(value = "获取INS博主列表")
    public String getBlogger(String data) throws UnsupportedEncodingException, ParamsException {
        InsBloggerSearchData searchData = getParam(InsBloggerSearchData.class, URLDecoder.decode(data,"UTF-8"));
        Page<InsBlogger> insBloggerPage = insBloggerService.getPageByEs(searchData);
        insBloggerPage.getList().forEach( insBlogger ->{
            InsFavorite insFavorite = insFavoriteService.getByTypeAndTargetIdAndUserId(FavoriteTypeEnum.INS_BLOGGER.getCode(),insBlogger.getUid(),(int)getUser().getId());

            if(null != insFavorite) {
               insBlogger.setCollectId(insFavorite.getId());
            }
        });
        return Ret.success("OK",insBloggerPage);
    }

    @ApiOperation(value = "搜索INS博主")
    @RequestMapping(value = "blogger/search",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation(value = "搜索INS博主")
    public String searchBlogger(String data) throws UnsupportedEncodingException, ParamsException {
        InsBloggerSearchData searchData = getParam(InsBloggerSearchData.class, URLDecoder.decode(data,"UTF-8"));

        if(searchData.getPage()*searchData.getPageSize()>10){
            return Ret.noPermission();
        }
        return Ret.success("OK",insBloggerService.getPageByEs(searchData));
    }

    /**
     * 获取INS博主账户概况-账户质量得分信息
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主账户概况-账户质量得分信息")
    @RequestMapping(value = "blogger/userGoal/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子趋势信息")
    public String userGoal(@PathVariable long uid) {
        return Ret.success("OK",insBloggerService.userGoal(uid));
    }

    /**
     * 获取INS博主账户概况-帖子趋势信息
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主账户概况-帖子趋势信息")
    @RequestMapping(value = "blogger/mediaTrend/{uid}/{dayType}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子趋势信息")
    public String mediaTrend(@PathVariable long uid,@PathVariable int dayType) {
        return Ret.success("OK",insMediaService.getMediaTrend(uid,dayType));
    }
    @ApiOperation(value = "获取INS博主账户概况-帖子趋势信息")
    @RequestMapping(value = "blogger/mediaTrend/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子趋势信息")
    public String mediaTrend(@PathVariable long uid) {
        return Ret.success("OK",insMediaService.getMediaTrend(uid,2));
    }

    /**
     * 获取INS博主账户概况-帖子发文时间
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主账户概况-帖子发文时间")
    @RequestMapping(value = "blogger/mediaTakenTime/{uid}/{dayType}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子发文时间")
    public String mediaTakenTime(@PathVariable long uid,@PathVariable int dayType) {
        return Ret.success("OK",insMediaService.getInsMediaTakenTimeInfoByUid(uid,dayType));
    }
    @ApiOperation(value = "获取INS博主账户概况-帖子发文时间")
    @RequestMapping(value = "blogger/mediaTakenTime/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子发文时间")
    public String mediaTakenTimeTemp(@PathVariable long uid) {
        return Ret.success("OK",insMediaService.getInsMediaTakenTimeInfoByUid(uid,2));
    }

    /**
     * 获取INS博主账户概况-近30天账户趋势
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主账户概况-近30天账户趋势")
    @RequestMapping(value = "blogger/userTrend/{uid}/{dayType}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子趋势信息")
    public String userTrend(@PathVariable long uid,@PathVariable int dayType) {
        return Ret.success("OK",insBloggerService.getUserTrend(uid,dayType));
    }

    @ApiOperation(value = "获取INS博主账户概况-近30天账户趋势")
    @RequestMapping(value = "blogger/userTrend/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子趋势信息")
    public String userTrendTemp(@PathVariable long uid) {
        return Ret.success("OK",insBloggerService.getUserTrend(uid,2));
    }

    /**
     * 获取INS博主账户概况-粉丝概况信息
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主账户概况-粉丝概况信息")
    @RequestMapping(value = "blogger/fansOverview/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主账户概况-帖子趋势信息")
    public String fansOverview(@PathVariable long uid) {
        return Ret.success("OK",insBloggerFansService.getFansOverview(uid));
    }

    /**
     * 获取INS博主粉丝画像-粉丝质量分析信息
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主粉丝画像-粉丝质量分析信息")
    @RequestMapping(value = "blogger/fansGoal/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主粉丝画像-粉丝质量分析信息")
    public String fansGoal(@PathVariable long uid) {
        return Ret.success("OK",insBloggerFansService.getFansGoal(uid));
    }

    /**
     * 获取INS博主粉丝画像-活跃粉丝信息
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主粉丝画像-活跃粉丝信息")
    @RequestMapping(value = "blogger/activeFansInfo/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主粉丝画像-活跃粉丝信息")
    public String activeFansInfo(@PathVariable long uid) {
        return Ret.success("OK",insBloggerFansService.getFansPortrait(uid));
    }

    /**
     * 获取INS博主粉丝画像-粉丝兴趣品牌分布信息
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主粉丝画像-粉丝兴趣品牌分布信息")
    @RequestMapping(value = "blogger/fansInterestBrand/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主粉丝画像-粉丝兴趣品牌分布信息")
    public String fansInterestBrand(@PathVariable long uid) {
        return Ret.success("OK",insBloggerFansService.getFansBrandCategory(uid));
    }

    /**
     * 获取INS博主粉丝画像-粉丝兴趣分布信息
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主粉丝画像-粉丝兴趣分布信息")
    @RequestMapping(value = "blogger/fansInterest/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主粉丝画像-粉丝兴趣分布信息")
    public String fansInterest(@PathVariable long uid) {
        return Ret.success("OK",insBloggerFansService.getFansCategory(uid));
    }

    /**
     * 获取INS博主粉丝画像-粉丝品牌亲和力信息
     * @param uid
     * @param page
     * @return
     */
    @ApiOperation(value = "获取INS博主粉丝画像-粉丝品牌亲和力信息")
    @RequestMapping(value = "blogger/fansLikeBrand/{uid}/{page}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主粉丝画像-粉丝品牌亲和力信息")
    public String fansLikeBrand(@PathVariable long uid,@PathVariable int page) {
        return Ret.success("OK",insBloggerFansService.getFansBrand(uid,page));
    }

    /**
     * 获取INS博主广告表现-广告得分
     * @param uid
     * @return
     */
    @ApiOperation(value = "获取INS博主广告表现-广告得分")
    @RequestMapping(value = "blogger/adGoal/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主广告表现-广告得分")
    public String adGoal(@PathVariable long uid) {
        return Ret.success("OK",insMediaService.getAdGoal(uid));
    }

    /**
     * 获取INS博主广告表现-标记品牌分页信息
     * @return
     */
    @ApiOperation(value = "获取INS博主广告表现-标记品牌分页信息")
    @RequestMapping(value = "blogger/adTagBrand",method = RequestMethod.POST,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.JSON)
    @Operation(value = "获取INS博主广告表现-标记品牌分页信息")
    public String adTagBrand(@RequestBody String data) throws ParamsException {
        InsAdMediaTagSearchRequest insAdMediaTagSearchRequest = getParam(InsAdMediaTagSearchRequest.class,data);
        return Ret.success("OK",insMediaService.getAdTagBrand(insAdMediaTagSearchRequest.getUid(),
                insAdMediaTagSearchRequest.getCategoryName(),
                insAdMediaTagSearchRequest.getPage(),insAdMediaTagSearchRequest.getPageSize()));
    }

    /**
     * 获取INS博主广告表现-标记品牌分类信息
     * @return
     */
    @ApiOperation(value = "获取INS博主广告表现-标记品牌分类信息")
    @RequestMapping(value = "blogger/adTagBrandCategory/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主广告表现-标记品牌分类信息")
    public String adTagBrandCategory(@PathVariable long uid) {
        return Ret.success("OK",insMediaService.getAdTagBrandCategory(uid));
    }

    /**
     * 获取INS博主广告表现-标记品牌帖子分页信息
     * @return
     */
    @ApiOperation(value = "获取INS博主广告表现-标记品牌帖子分页信息")
    @RequestMapping(value = "blogger/adTagBrandMedia",method = RequestMethod.POST,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.JSON)
    @Operation(value = "获取INS博主广告表现-标记品牌帖子分页信息")
    public String adTagBrandMedia(@RequestBody String data) throws ParamsException {
        InsAdMediaTagSearchRequest insAdMediaTagSearchRequest = getParam(InsAdMediaTagSearchRequest.class,data);
        return Ret.success("OK",insMediaService.getAdTagBrandMedia(insAdMediaTagSearchRequest.getUid(),
                insAdMediaTagSearchRequest.getCategoryName(),insAdMediaTagSearchRequest.getOrderType(),
                insAdMediaTagSearchRequest.getPage(),insAdMediaTagSearchRequest.getPageSize()));
    }

    /**
     * 获取INS博主广告表现-标记品牌帖子分类信息
     * @return
     */
    @ApiOperation(value = "获取INS博主广告表现-标记品牌帖子分类信息")
    @RequestMapping(value = "blogger/adTagBrandMediaCategory/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @RequestLimit(value = "BloggerIdLimit",property = "uid",platformType = PlatformTypeEnum.INS,validateType = Limit.REPORT_LIMIT,paramType = ParamsType.URL)
    @Operation(value = "获取INS博主广告表现-标记品牌帖子分类信息")
    public String adTagBrandMediaCategory(@PathVariable long uid) {
        return Ret.success("OK",insMediaService.getAdTagBrandMediaCategory(uid));
    }

    /**
     *
     * @return
     */
    @ApiOperation(value = "验证是否可以解锁报告")
    @RequestMapping(value = "blogger/report/unlock/checked",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation(value = "验证是否可以解锁报告")
    public String checkedUnlockedBloggerReport(){
        String msg = "";
        Map<String,Object> result = new HashMap<>();
        if(getRoleId() >2){
            int roleReportNumber = productPerService.unlockedNumberByRole(getUser().getId(),getRoleId(),ReportTypeEnum.BLOGGER.getMsg());
            msg = "Your daily reports balance is "+roleReportNumber+" reports.";
            if(roleReportNumber > 0){
                msg += " Unlock this report costs 1 daily report. Do you want to continue?";
                result.put("type",1);
                return Ret.success(msg,result);
            }
        }
        int reportStarterNumber = productPerService.unlockedNumberByReportStarter(getUser().getId());

        if(reportStarterNumber > 0){
            msg += "Your credits reports balance is "+reportStarterNumber+". Unlock this report costs 1 credit. Do you want to continue?";
            result.put("type",2);
            return Ret.success(msg,result);
        }
        return Ret.success("Insufficient daily reports. Please try again tomorrow or purchase credits.");
    }

    /**
     *
     * @param body
     * @return
     * @throws ParamsException
     */
    @ApiOperation(value = "解锁报告")
    @RequestMapping(value = "blogger/report/unlock",method = RequestMethod.POST,produces = "application/json;charset=UTF-8")
    @Operation(value = "解锁报告")
    public String unlockedBloggerReport(@RequestBody String body) throws ParamsException {
        Long uid = getParam(Long.class,body,"uid");
        if(productPerService.isUnlocked(getUser().getId(),uid, PlatformTypeEnum.INS.getCode())){
            return Ret.success("你已解锁过了");
        }

        if(productPerService.unlockedByUserRole(getUser().getId(),getRoleId(),uid,PlatformTypeEnum.INS.getCode(), ReportTypeEnum.BLOGGER.getCode(), ReportTypeEnum.BLOGGER.getMsg())){
            return Ret.success("解锁成功");
        }

        if(productPerService.unlockedByReportStarter(getUser().getId(),uid, PlatformTypeEnum.INS.getCode(), ReportTypeEnum.BLOGGER.getCode())){
            return Ret.success("解锁成功");
        }
        return Ret.err("解锁失败");
    }


   //################################################Product Tagged START################################################

    @ApiOperation("标记商品的帖子统计信息")
    @RequestMapping(value = "blogger/product/media/st",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation("标记商品的帖子统计信息")
    public String getProductMediaSt(String data) throws UnsupportedEncodingException, ParamsException {
        Long uid = getParam(Long.class,URLDecoder.decode(data,"UTF-8"),"uid");
        int dayType = getParam(Integer.class,URLDecoder.decode(data,"UTF-8"),"dayType");
        return Ret.success("SUCCESS",insBloggerService.getProductMediaSt(uid,dayType));
    }

    @ApiOperation("ins博主相关的商品")
    @RequestMapping(value = "blogger/rel/product",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation("ins博主相关的商品")
    public String getProductByUid(String data) throws ParamsException, UnsupportedEncodingException {
        InsBloggerProductRequest insProductRelListRequest = getParam(InsBloggerProductRequest.class,URLDecoder.decode(data,"UTF-8"));
        return Ret.success("SUCCESS!",insProductService.getProductDataByUid(insProductRelListRequest.getUid(),insProductRelListRequest.getPage(),insProductRelListRequest.getPageSize(),insProductRelListRequest.getCategory(),insProductRelListRequest.getDayType()));
    }


    @ApiOperation("ins博主相关的商品分类统计")
    @RequestMapping(value = "blogger/product/category/count",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation("ins博主相关的商品分类统计")
    public String getProductCountByCategory(String data) throws ParamsException, UnsupportedEncodingException {
        Long uid = getParam(Long.class,URLDecoder.decode(data,"UTF-8"),"uid");
        int dayType = getParam(Integer.class,URLDecoder.decode(data,"UTF-8"),"dayType");
        return Ret.success("SUCCESS!",insProductService.getCountCategory(uid,dayType));
    }

    //################################################Product Tagged END################################################

    @ApiOperation("ins商品相关帖子")
    @RequestMapping(value = "blogger/product/rel/media",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation("ins商品相关帖子")
    public String getProductMedia(String data) throws ParamsException, UnsupportedEncodingException {
        InsProductRelListRequest insProductRelListRequest = getParam(InsProductRelListRequest.class,URLDecoder.decode(data,"UTF-8"));
        return Ret.success("SUCCESS!",insProductService.getProductMediaForNowData(insProductRelListRequest.getProductId(),insProductRelListRequest.getUid(),insProductRelListRequest.getPage(),insProductRelListRequest.getPageSize(),insProductRelListRequest.getMediaType(),insProductRelListRequest.getDayType()));
    }

    @ApiOperation("博主帖子统计信息")
    @RequestMapping(value = "blogger/media/st/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation(value = "博主帖子统计信息")
    public String getInsBloggerMediaInfo(@PathVariable long uid,String data) throws UnsupportedEncodingException, ParamsException {
        Integer dayType = getParam(Integer.class,URLDecoder.decode(data,"UTF-8"),"dayType");
        return Ret.success("SUCCESS",insMediaService.getInsBloggerMediaInfo(uid,dayType));
    }

    @ApiOperation("博主帖子列表")
    @RequestMapping(value = "blogger/media/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation(value = "博主帖子列表")
    public String getInsBloggerMediaPage(@PathVariable long uid,String data) throws UnsupportedEncodingException, ParamsException {
        InsBloggerMediaRequest request = getParam(InsBloggerMediaRequest.class,URLDecoder.decode(data,"UTF-8"));
        return Ret.success("SUCCESS",insMediaService.getPageByUid(uid,request.getPage(),request.getPageSize(),request.getMediaType(),request.getSponsored(),request.getBusiness(),request.getProduct(),request.getDayType(),request.getSort()));
    }

    //################################################Business Tagged START################################################
    /**
     * 标记该博主的帖子统计信息
     * @return
     */
    @ApiOperation("标记该博主的帖子统计信息")
    @RequestMapping(value = "blogger/tagged/st/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation(value = "标记该博主的帖子统计信息")
    public TaggedMediaCountResp getTaggerBloggerCountByUid(@PathVariable long uid) throws UnsupportedEncodingException, ParamsException {
        return insBloggerService.getTaggerBloggerCountByUid(uid);
    }

    /**
     * 标记该博主的博主分类统计
     * @return
     */
    @ApiOperation("标记该博主的博主分类统计")
    @RequestMapping(value = "blogger/tagged/category/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation(value = "标记该博主的博主分类统计")
    public List<InsBloggerCategoryStatistics> getCountTaggerCategory(@PathVariable long uid) throws UnsupportedEncodingException, ParamsException {
        return insBloggerService.getCountTaggerCategory(uid);
    }

    /**
     * 标记该博主的博主分页信息
     * @return
     */
    @ApiOperation("标记该博主的博主分页信息")
    @RequestMapping(value = "blogger/tagged/page/{uid}",method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
    @Operation(value = "标记该博主的博主分页信息")
    public Page<InsTaggerBloggerResp> getTaggerBloggerPage(@PathVariable long uid,String data) throws UnsupportedEncodingException, ParamsException {
        InsTaggerBloggerReq request = getParam(InsTaggerBloggerReq.class,URLDecoder.decode(data,"UTF-8"));
        request.setUid(uid);
        return insBloggerService.getTaggerBloggerPage(request);
    }
}
